﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Serialization;

namespace Js_Study.map
{
    public partial class Ajax : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string tag = Request["tag"] ?? string.Empty;
            if (tag == "getData")
            {
                string id = Request["id"] ?? string.Empty;

                var data = @"[
    { name: '张三', city: [[{ name: '上海' }, { name: '北京', value: '客户名称:中心证券,<br/>客户接见人:咩咩!,<br/>客户电话:10086' }], [{ name: '武汉' }, { name: '深圳' }], [{ name: '武汉' }, { name: '深圳' }]] },
    { name: '李四', city: [[{ name: '广州' }, { name: '成都' }]] }
    ];";
                Response.Write(data);
            }

            if (tag == "getOtherData")
            {
                string id = Request["id"] ?? string.Empty;

                var data = @"[
    { name: '咩咩', city: [[{ name: '武汉' }, { name: '广州', value: '客户名称:中心证券,<br/>客户接见人:咩咩!,<br/>客户电话:10086' }], [{ name: '武汉' }, { name: '南京' }]] },
    { name: '乖乖', city: [] }
    ];";
                Response.Write(data);
            }

            if (tag == "getNullData")
            {
                string id = Request["id"] ?? string.Empty;

                var data = @"[
    { name: '咩咩', city: [] },
    { name: '乖乖', city: [] }
    ];";
                Response.Write(data);
            }
            if (tag == "pie")
            {
                var data = @"[
                    { value: '335', name: '直接访问' },
                    { value: '310', name: '邮件营销' },
                    { value: '234', name: '联盟广告' },
                    { value: '135', name: '视频广告' },
                    { value: '1548', name: '搜索引擎' }
                ];";

                Response.Write(data);
            }
        }
    }
}